<Cascader style="width:400px;" Data="data">
    <ItemSlot>
        @context.Text
        @if (context.Children.Any())
        {
            <span>(@context.Children.Count)</span>    
        }
    </ItemSlot>
</Cascader>

@code{
    
    //下面为了方便，直接从json文件加载数据
    static string dataFile = "Pages/data/data1.json";
    List<CascaderItem<string>> data = Cascader<string>.BuildDataFromJson(System.IO.File.ReadAllText(dataFile));
}